﻿Public Class frmdruginformation
    Dim strsql As String
    Dim mysql As New ClsSQLhelper
#Region "Function"
    Sub Search_Druginfo()
        With DataGridView1
            Try
                If Me.TxtDSTD.Text = "" Then
                    MsgBox("กรุณาใส่รหัสยามาตรฐาน", MsgBoxStyle.Exclamation)
                    Exit Sub
                End If

                strsql = "Select STD_CODE,TRADENAME,DRUGNAME,STRENGTH,DGDSFNM,UNIT,COMP,REGNO from l_DRUGS where STD_CODE lIKE  '" & Me.TxtDSTD.Text & "%'"
                Dim DTICD10 As New DataTable
                DTICD10 = mysql.GetMYSQLDataTable(strsql, "l_icd10")

                .RowHeadersVisible = False
                .AllowDrop = False
                .AllowUserToAddRows = False
                .AllowUserToDeleteRows = False
                .AllowUserToOrderColumns = True
                .AllowUserToResizeColumns = True
                .AllowUserToResizeRows = False
                .MultiSelect = False
                .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells
                .AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
                .DataSource = DTICD10
                .ReadOnly = True
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        End With
    End Sub

#End Region
    Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

    End Sub

    Private Sub BtnFind_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFind.Click
        Search_Druginfo()
    End Sub
End Class